package com.vinyl.sound 
{
	import com.vinyl.sound.SoundLoader;
	import com.vinyl.sound.SoundProxy;
	
	
	/**
	 * ...
	 * @author 
	 */
	public class SoundService
	{
		
		private static var instance:SoundService;
		private var soundList:Object = {};
		
		public function SoundService()
		{
			if(instance != null)
			{
				throw new Error("DataService Singleton already constructed!");
			}
		}
		
		public static function getInstance():SoundService
		{
			if(instance == null)
			{
				instance = new SoundService();
			}
			
			return instance;
		}
		
		public function loadSound( url:String )
		{
			var sl:SoundLoader = soundList[url] as SoundLoader;
			if( !sl )
			{
				sl = new SoundLoader( url );
				soundList[url] = sl;
			}
			return new SoundProxy( sl );
		}
	}
}